﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NewsSevicer.ResultClass
{
    public  class RequestResult<T>: ResultData
    {

     public static RequestResult<T> Create(int code,T data, string message = null)
        {
            return new RequestResult<T>()
            {
                code = code,
                data = data,
                message = message
            };
        }

 

        public  RequestResult<T> success<T>(T data) {
           
            return new RequestResult<T> {code=0, message="请求成功", data=data};
        
        }

        public RequestResult<T> fail<T>()
        {

            return new RequestResult<T> { code = 1, message = "请求参数不正确", data = null };

        }
    }
}
